﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LogisticsAdmin.DAL;

namespace LogisticsAdmin.BLL
{
    public class UserBLL
    {
        public string Reg(string account, string tel, string pwd, string name)
        {
            string msg;
            UserDAL userDAL = new UserDAL();
            if (userDAL.IsTel(tel) != null)//该手机号已存在
            {
                msg = "该手机号已存在";
            }
            else if (userDAL.IsAccount(account) != null)
            {
                msg = "该账号号已存在";
            }
            else
            {
                if (userDAL.Reg(account, tel, pwd, name) > 0)
                {
                    msg = "注册成功";
                }
                else
                {
                    msg = "注册失败";
                }
            }
            return msg;
        }
    }
}
